package entities;

import util.DataVerify;

public class Video extends Product
{
	private String preview;
	private String categories;
	private String sypnosis;
	
	/**
	 * 
	 */
	public Video() {
	}

	/**
	 * @param preview
	 * @param categories
	 * @param sypnosis
	 */
	public Video(String preview, String categories, String sypnosis,
			Long product_id, String price, String dateAdded,
			String title, String duration, String productionDate,
			String format, int stockQty, String img) {
		super(product_id, price, dateAdded, title, duration, productionDate,
				format, stockQty, img);
		this.preview = preview;
		this.categories = categories;
		this.sypnosis = sypnosis;
	}

	public String getTitle(){
		return super.getTitle();
	}
	public void setTitle(String title){
		super.setTitle(title);
	}
	public String getPreview() {
		return preview;
	}

	public void setPreview(String preview) {
		this.preview = preview;
	}

	public String getCategories() {
		return categories;
	}

	public void setCategories(String categories) {
		this.categories = categories;
	}

	public String getsypnosis() {
		return sypnosis;
	}

	public void setsypnosis(String sypnosis) {
		this.sypnosis = sypnosis;
	}

	public static Video newInstance(String preview, String categories, String sypnosis,
			Long product_id, String price, String dateAdded,
			String title, String duration, String productionDate,
			String format, int stockQty, String img){
		DataVerify.verifyObject("preview",preview);
		DataVerify.verifyObject("categories",categories);
		DataVerify.verifyObject("sypnosis",sypnosis);
		DataVerify.verifyObject("product_id",product_id);
		DataVerify.verifyObject("stock_price",Float.valueOf(price));
		DataVerify.verifyObject("dateAdded",dateAdded);
		DataVerify.verifyObject("title",title);
		DataVerify.verifyObject("duration",duration);
		DataVerify.verifyObject("productionDate",productionDate);
		DataVerify.verifyObject("format",format);
		DataVerify.verifyObject("stockQty",stockQty);
		DataVerify.verifyObject("price",price);
		DataVerify.verifyObject("img",img);
		
		return new Video(preview, categories, sypnosis,
				product_id, price, dateAdded,
				title, duration, productionDate,
				format, stockQty, img);
	}
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (!super.equals(obj))
			return false;
		if (getClass() != obj.getClass())
			return false;
		Video other = (Video) obj;
		if (categories == null) {
			if (other.categories != null)
				return false;
		} else if (!categories.equals(other.categories))
			return false;
		if (preview == null) {
			if (other.preview != null)
				return false;
		} else if (!preview.equals(other.preview))
			return false;
		if (sypnosis == null) {
			if (other.sypnosis != null)
				return false;
		} else if (!sypnosis.equals(other.sypnosis))
			return false;
		return true;
	}
	
	
}
